package com.woniu.controller;


import com.woniu.commons.exception.YogaException;
import com.woniu.commons.model.Result;
import com.woniu.commons.util.JwtUtil;
import com.woniu.model.form.AddLeagueClassOrderPeopleForm;
import com.woniu.model.model.YLeagueClassOrderPeople;
import com.woniu.service.YLeagueClassOrderPeopleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author 吴彦祖
 * @since 2024年05月23日
 */
@RestController
@RequestMapping("/yLeagueClassOrderPeople")
@Api(tags = "团课学员接口")
public class YLeagueClassOrderPeopleController {

    @Resource
    private YLeagueClassOrderPeopleService leagueClassOrderPeopleService;

    /**
     * 新增团课的用户名单
     * @return
     */
    @PostMapping("/addLeagueClassOrderPeople")
    @ApiOperation("新增团课的用户名单")
    public Result<?> addLeagueClassOrderPeople(@RequestBody AddLeagueClassOrderPeopleForm form) {

        Integer i = leagueClassOrderPeopleService.addLeagueClassOrderPeople(form);

        if (!i.equals(1)){
            return Result.getResult().setCode(500).setMsg("新增失败");
        }

        return Result.getResult().setMsg("新增成功");
    }


}

